package com.woniuxy.death.controller;

import com.woniuxy.po.Mail;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: 马宇航
 * @Description:
 * @DateTime: 22/12/29/0029 17:45
 * @Component: 成都蜗牛学苑
 **/
@Controller
public class DeathController {
    @Autowired
    RabbitTemplate rabbitTemplate;
    @RequestMapping("ttlToDead")
    @ResponseBody
    public void sendTTL(@ModelAttribute("mail") Mail mail){
        rabbitTemplate.convertAndSend("normalEx","routingkey1",mail);
    }
    @RequestMapping("normalQueue")
    @ResponseBody
    public void sendLengh(@ModelAttribute("mail") Mail mail){
        rabbitTemplate.convertAndSend("normalEx","routingkey2",mail);
    }
}
